import axios from 'axios'

const detailModule = {
  namespaced: true,
  state () {
    return {
      detailMovie: {}
    }
  },
  mutations: {

    updateDetailMovie (state, payload) {
      state.detailMovie = { ...payload }
    }
  },
  actions: {
    async getDetailMovie ({ commit, id }) {
      const res = await axios.get('http://test.zjie.wang/api/hot/' + id)
      commit('updateDetailMovie', res.data)
      console.log(res)
    }
  }
}

export default detailModule
